//
//  WQStatusNormalCell.swift
//  sanwuWeibo
//
//  Created by 王先强 on 15/12/13.
//  Copyright © 2015年 王先强. All rights reserved.
//

import UIKit

class WQStatusNormalCell: WQHomeCell {
    
   override var statusViewModel: WQStatusViewModel? {
    
        didSet {
            //设置数据后更新pictureView的宽高
            //            print(pictureView.bounds)
            pictureView.snp_updateConstraints { (make) -> Void in
                make.height.equalTo(pictureView.bounds.height)
                make.width.equalTo(pictureView.bounds.width)
                
                let offset: CGFloat = (statusViewModel?.thumbnailUrls.count > 0) ? homeCellSubViewsMargin : 0
                make.top.equalTo(contentLabel.snp_bottom).offset(offset)
                
            }
            
        }
    }
    
    override func setupUI() {
        super.setupUI()
        pictureView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(self.contentLabel.snp_bottom).offset(homeCellSubViewsMargin)
            make.left.equalTo(self.contentLabel.snp_left)
//            make.width.equalTo(300)
//            make.height.equalTo(120)
        }
    }
}